/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: PACKAGE_NAME
 * @ClassName: GuessMachine
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/10/3 17:35
 * @Copyright 金斗版板所有
 */
public class GuessMachine {
    String  name;
    int   money;

    public GuessMachine(){

    }

    public GuessMachine( String name,int money ){
        this.name=name;
        this.money=money;
    }
    public String guess( int money){
        int moneys=0;
        String elements=null;
        int num=(int)(Math.random()*3);
        GuessMachine [] guessMachines={new GuessMachine("小米电视剧",
                3399),new GuessMachine("LG电视",5999),
                new GuessMachine("海信电视",12999)};
        switch (num) {
            case 1:
                moneys = guessMachines[0].money;
                break;
            case 2:
                moneys = guessMachines[1].money;
                break;
            case 3:
                moneys = guessMachines[2].money;
                break;
        }
        if (moneys<money){
            elements="再小些";
        }else if (moneys>money){
            elements="再大些";
        }else {
            elements="猜对了";
        }
        return elements;
    }
}
